36940c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2010 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,8 +36,8 @@
import org.springframework.util.Assert;
  *
  * @author Arjen Poutsma
  * @author Juergen Hoeller
- * @see <a href="http://bitworking.org/projects/URI-Templates/">URI Templates</a>
  * @since 3.0
+ * @see <a href="http://bitworking.org/projects/URI-Templates/">URI Templates</a>
  */
 public class UriTemplate {
 
@@ -126,7 +126,7 @@
public class UriTemplate {
 		int i = 0;
 		while (matcher.find()) {
 			String uriVariable = uriVariableValues[i++].toString();
-			matcher.appendReplacement(buffer, uriVariable);
+			matcher.appendReplacement(buffer, Matcher.quoteReplacement(uriVariable));
 		}
 		matcher.appendTail(buffer);
 		return encodeUri(buffer.toString());
